﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminMaster.master" AutoEventWireup="true" CodeBehind="ListUsers.aspx.cs" Inherits="doris.Admin.ListUsers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h2>Brukere</h2>
<script language="javascript" type="text/javascript">
     //--- For Checkbox in Gridview
function SelectAll(id)
      {
       var frm = document.forms[0];
            
            for (i=0;i<frm.elements.length;i++)
            {
                if (frm.elements[i].type =="checkbox")
                {
           frm.elements[i].checked = document.getElementById(id).checked;
           
                }
            }

        }
</script>
    <b>Antall registerte brukere: <asp:Literal ID="lblTotalUsers" runat="server"></asp:Literal> - P&aring;logget: <asp:Literal ID="lblOnlineUsers" runat="server"></asp:Literal></b>
    <p><asp:Repeater ID="rptAlphabetBar" runat="server" OnItemCommand="rptAlphabetBar_ItemCommand">
        <ItemTemplate>
            <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# Container.DataItem %>'
                Text='<%# Container.DataItem %>'></asp:LinkButton></ItemTemplate></asp:Repeater>
    </p>
    S&oslash;k etter brukernavn / epost: <p>
    </p>
    <asp:DropDownList ID="ddlUserSearchTypes" runat="server" Style="position: static">
        <asp:ListItem Selected="true" Text="UserName"></asp:ListItem><asp:ListItem Text="E-mail"></asp:ListItem></asp:DropDownList> inneholder <asp:TextBox ID="txtSearchText" runat="server" Style="position: static"></asp:TextBox><asp:Button ID="btnSearch" runat="server" Font-Bold="True" OnClick="btnSearch_Click"
        Style="position: static" Text="S&oslash;k" BackColor="White" BorderColor="#507CD1"
        BorderStyle="Solid" BorderWidth="1px" Font-Names="Times New Roman"
        Font-Size="10.5pt" ForeColor="#284E98"/>
    <br />
    <br />
    <br />
    <div style="height: 150px; overflow: auto;">
    <asp:GridView ID="gvUsers" runat="server" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="UserName" 
        CssClass="dorisGrid" AlternatingRowStyle-CssClass="alt" OnDataBound="gvUsers_DataBound" OnRowDataBound="gvUsers_RowDataBound">
        <Columns>
            <asp:TemplateField>
                <HeaderTemplate>
                    <asp:CheckBox ID="cbxAll" runat="server" Style="position: static" />
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox ID="cbxId" runat="server" Style="position: static" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Brukernavn">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("UserName") %>'></asp:TextBox></EditItemTemplate><ItemTemplate>
                    <asp:Label ID="lblUserName" runat="server" Text='<%# Bind("UserName") %>'></asp:Label></ItemTemplate></asp:TemplateField><asp:BoundField DataField="Email" HeaderText="Email" DataFormatString="<a href=mailto:{0}>{0}</a>" HtmlEncode="False" />
            <asp:TemplateField HeaderText="Opprettet">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("CreationDate") %>'></asp:TextBox></EditItemTemplate><ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("CreationDate", "{0:dd/MM/yyyy}") %>'></asp:Label></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="Sist aktiv">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("LastActivityDate") %>'></asp:TextBox></EditItemTemplate><ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("LastActivityDate",  "{0:dd/MM/yyyy}") %>'></asp:Label></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="Er godkjent">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("IsApproved") %>'></asp:TextBox></EditItemTemplate><ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("IsApproved") %>' Visible="False"></asp:Label><asp:Image ID="Image1" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" Style="position: static" NavigateUrl='<%# Eval("UserName", "~/Admin/UpdateUser.aspx?Id={0}") %>'>Endre</asp:HyperLink></ItemTemplate></asp:TemplateField></Columns><RowStyle BackColor="#EFF3FB" />
        <EmptyDataTemplate>
            Ingen brukere.</EmptyDataTemplate><EditRowStyle/>
    </asp:GridView>
</div>
    <br />
    <asp:Button ID="btn_Delete" runat="server" CssClass="SubmitBtn" Font-Bold="True"
        OnClick="btn_Delete_Click" Style="position: static" Text="Slett valgte" BackColor="White" BorderColor="#507CD1"
                            BorderStyle="Solid" BorderWidth="1px" Font-Names="Times New Roman"
                            Font-Size="10.5pt" ForeColor="#284E98"/><br />
    <br />
    <asp:Label ID="lblMsg" runat="server" Font-Bold="True" ForeColor="#FF0000" Style="position: static"
        Width="211px"></asp:Label><br />




    </asp:Content>
